﻿import com.dinmax.factorium.*

class FactoriumCielo
extends MovieClip {
	
	private var MAX_DIF:Number = 70;
	private var F_VELOCITY:Number = 30;
		
	private var nCenter:Number = (Stage.width)/2;
	private var canMove:Boolean = true;
	
	//estas variables son los movieClips que tiene dibujados adentro
	private var cieloA:MovieClip;
	private var cieloB:MovieClip;
	
	function onEnterFrame():Void {
		if(this.canMove){
			var nDif:Number = -25;
			if(Math.abs(nDif) < MAX_DIF){
				this._x += nDif/F_VELOCITY;
			} else {
				(nDif < 0)? this._x -= MAX_DIF/F_VELOCITY : this._x += MAX_DIF/F_VELOCITY;
			}; // fin del if
			
			if(this._x < (cieloA._width*-1)){
				this._x = 0;
			}
		}
	
	}; // fin del onEnterFrame
	
	public function stopMove():Void {
		this.canMove = false;
		return;
	}
	
};